package com.example.myproject.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("messages")
public class Message {
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("conversation_id")
    private Long conversationId;

    @TableField("from_user_id")
    private Long fromUserId;

    @TableField("to_user_id")
    private Long toUserId;

    @TableField("content")
    private String content;

    @TableField("content_type")
    private String contentType;

    @TableField("sent_at")
    private LocalDateTime sentAt;

    @TableField("status")
    private String status;

    @TableField("is_read")
    private Boolean isRead;

    @TableField(exist = false)
    private User fromUser;

    @TableField(exist = false)
    private User toUser;
}